Check Shortcut Last Run Time
(
71
actions, 44 KB)
0 Get Dictionary from
[Shortcut Input]
➔ inputDict
»
2
7
66
1 Format Date
[CurrentDate]
»
12
22
28
34
40
46
52
58
63
DateFormatStyle
:
Medium
TimeFormatStyle
:
Medium
2 Text
➔ keyPath
»
3
5
68
My Apple Shortcuts.shortcutLastRunTime.
[0 inputDict
.shortcutName
]
3 DataJar > CheckIfValueExistsIntent »
keyPath
:
[2 keyPath]
4 If
[3 Value Exists
as Boolean
]
is true
NumberValue
:
ConditionalActionString
:
No
5 DataJar > GetValueIntent »
keyPath
:
[2 keyPath]
6 Get Dates from
[5 Value]
»
10
20
26
32
38
44
50
56
7 Get Dictionary Value for
checkInterval
in
[0 inputDict]
»
8 Change
[7 Dictionary Value]
to
lowercase
»
9
15
9 If
[8 Updated Text]
is
today
10 If
[6 Dates]
is today
Duration
:
"" sec
11 Otherwise
12 Set Variable
runShortcut?
to
[1 Formatted Date]
13 End If
14 Otherwise
15 Split Text
[8 Updated Text]
by
Spaces
»
16
18
16 Get First Item from List
[15 Split Text]
➔ number
»
17 Get Numbers from
[16 number]
»
20
26
32
38
44
50
56
18 Get
Last Item
from List
[15 Split Text]
➔ unit
»
19
25
31
37
43
49
55
19 If
[18 unit]
contains
second
20 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
sec
21 Otherwise
22 Set Variable
runShortcut?
to
[1 Formatted Date]
23 End If
24 End If
25 If
[18 unit]
contains
minute
26 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
min
27 Otherwise
28 Set Variable
runShortcut?
to
[1 Formatted Date]
29 End If
30 End If
31 If
[18 unit]
contains
hour
32 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
hr
33 Otherwise
34 Set Variable
runShortcut?
to
[1 Formatted Date]
35 End If
36 End If
37 If
[18 unit]
contains
day
38 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
days
39 Otherwise
40 Set Variable
runShortcut?
to
[1 Formatted Date]
41 End If
42 End If
43 If
[18 unit]
contains
week
44 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
weeks
45 Otherwise
46 Set Variable
runShortcut?
to
[1 Formatted Date]
47 End If
48 End If
49 If
[18 unit]
contains
month
50 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
months
51 Otherwise
52 Set Variable
runShortcut?
to
[1 Formatted Date]
53 End If
54 End If
55 If
[18 unit]
contains
year
56 If
[6 Dates]
is in the last
NumberValue
1
Duration
[17 Numbers]
years
57 Otherwise
58 Set Variable
runShortcut?
to
[1 Formatted Date]
59 End If
60 End If
61 End If ▵
14
62 Otherwise ▵
4
63 Set Variable
runShortcut?
to
[1 Formatted Date]
64 End If
65 If
[runShortcut?]
has any value
66 Text »
[0 inputDict
.shortcutName
]
- Kernel
67 Run Shortcut
[66 Text]
Workflow
:
[66 Text]
68 DataJar > SetValueIntent
overwriteStrategy
:
alwaysAllow
keyPath
:
[2 keyPath]
valueConversionMode
:
text
values
:
[runShortcut?
as Date
]
69 End If
70 Stop This Shortcut